﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using TinyPMS_Jerusalem.Models.DBModel;

namespace TinyPMS_Jerusalem.Models
{
    public class ActionLogModel
    {
        public List<BorrowLog> GetUserBorrowActionLog(string userName)
        {
            Repository<BorrowLog> repository = new Repository<BorrowLog>(new DBModelDataContext());
            List<BorrowLog> list = repository.GetAll(g => g.UserName == userName).ToList();
            //有没有出借记录不是后台应该管的事，这些在View中判断即可
            return list;
        }

        public List<BorrowLog> GetAllPendingBorrowActionLog()
        {
            Repository<BorrowLog> repository = new Repository<BorrowLog>(new DBModelDataContext());
            List<BorrowLog> list = repository.GetAll(g => g.IsApproved == false).ToList();
            return list;
        }
    }
}
